package Java7_Concurrency_Cookbook.concurrent_custom.custom_priority_transfer_queue;

/**
 * @author lixiangke
 * @date 2017/11/28
 */
public class Producer implements Runnable {
    MyPriorityTransferQueue<Event> buffer;

    public Producer(MyPriorityTransferQueue<Event> buffer) {
        this.buffer = buffer;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            String tName = Thread.currentThread().getName();
            Event event = new Event(tName, i);
            buffer.put(event);
        }
    }
}
